package com.jhd.jiangxi.vo;

import com.jhd.jiangxi.R;
import com.jhd.jiangxi.ScanApplication;

import net.zigin.commons.util.StringUtil;

import java.util.List;

public class MainImg {
    public static String[] name={"供应入库","采购入库","退货入库","报废入库","调拨入库","召回入库","赠品入库","盘盈入库","供应出库","退货出库","损坏出库","销毁出库","报废出库","调拨出库","召回出库","抽检出库","盘亏出库"};//,"扫描识别"
    public static int[] img={R.mipmap.supply_in,R.mipmap.purchase_in,R.mipmap.return_in,R.mipmap.scrap_in,
            R.mipmap.allot_in,R.mipmap.recall_in,R.mipmap.gift_in,R.mipmap.check_in,R.mipmap.supply_out,
            R.mipmap.return_out,R.mipmap.damage_out,R.mipmap.ruin_out,R.mipmap.scrap_out,R.mipmap.allocation_out,
            R.mipmap.recall_out,R.mipmap.spot_out,R.mipmap.check_out};
    public static void showType(List<NameAndImg> nameAndImgList, ScanApplication application){
        if(!StringUtil.isNullOrEmpty(application.getDeptType())){
            if(application.getDeptType().equals("0")){//省疾控
                for (int i = 0; i < name.length; i++) {//
                    if(i!=0&&i!=12&&i!=13){
                        NameAndImg nameAndImg=new NameAndImg();
                        nameAndImg.setImage(MainImg.img[i]);
                        nameAndImg.setName(MainImg.name[i]);
                        nameAndImgList.add(nameAndImg);
                    }
                }
            }else if(application.getDeptType().equals("1")||application.getDeptType().equals("2")){//市、区县疾控单位
                for (int i = 0; i < name.length; i++) {
                    NameAndImg nameAndImg=new NameAndImg();
                    nameAndImg.setImage(MainImg.img[i]);
                    nameAndImg.setName(MainImg.name[i]);
                    nameAndImgList.add(nameAndImg);
                }
            }else{//门诊
                for (int i = 0; i < name.length; i++) {
                    if(i==0||i==4||i==7||i==6||i==9||i==10||i==13||i==14||i==15||i==16||i==12){
                        NameAndImg nameAndImg=new NameAndImg();
                        nameAndImg.setImage(MainImg.img[i]);
                        nameAndImg.setName(MainImg.name[i]);
                        nameAndImgList.add(nameAndImg);
                    }
                }
            }

            /*//供应入库，非省疾控展示
            if(!application.getDeptType().equals("0"))   {
                NameAndImg nameAndImg=new NameAndImg();
                nameAndImg.setImage(MainImg.img[0]);
                nameAndImg.setName(MainImg.name[0]);
                nameAndImgList.add(nameAndImg);
            }
            //采购入库，非门诊疾控展示
            if(Integer.valueOf(application.getDeptType())<=2){
                NameAndImg nameAndImg=new NameAndImg();
                nameAndImg.setImage(MainImg.img[1]);
                nameAndImg.setName(MainImg.name[1]);
                nameAndImgList.add(nameAndImg);
            }
            //供应出库，非门诊疾控展示
            if(Integer.valueOf(application.getDeptType())<=2){
                NameAndImg nameAndImg=new NameAndImg();
                nameAndImg.setImage(MainImg.img[2]);
                nameAndImg.setName(MainImg.name[2]);
                nameAndImgList.add(nameAndImg);
            }
            //退货出库
            NameAndImg nameAndImg=new NameAndImg();
            nameAndImg.setImage(MainImg.img[3]);
            nameAndImg.setName(MainImg.name[3]);
            nameAndImgList.add(nameAndImg);
            //盘盈入库
            NameAndImg nameAndImg4=new NameAndImg();
            nameAndImg4.setImage(MainImg.img[4]);
            nameAndImg4.setName(MainImg.name[4]);
            nameAndImgList.add(nameAndImg4);
            //盘亏出库
            NameAndImg nameAndImg5=new NameAndImg();
            nameAndImg5.setImage(MainImg.img[5]);
            nameAndImg5.setName(MainImg.name[5]);
            nameAndImgList.add(nameAndImg5);*/
        }else{
            for (int i=0;i<MainImg.name.length;i++) {
                NameAndImg nameAndImg=new NameAndImg();
                nameAndImg.setImage(MainImg.img[0]);
                nameAndImg.setName(MainImg.name[0]);
                nameAndImgList.add(nameAndImg);
            }
        }
    }
}
